import java.util.Arrays;

public class TestHeapSort {
    public static void main(String[] args) {
        // 1. 创建测试数组
        int[] testArray = {9, 3, 7, 1, 5, 8};

        // 2. 初始化堆排序对象
        HeapSort heapSort = new HeapSort();
        heapSort.initElem(testArray);

        System.out.println("排序前: " + Arrays.toString(heapSort.elem));

        // 3. 执行堆排序
        heapSort.heapSort();

        // 4. 打印结果
        System.out.println("排序后: " + Arrays.toString(heapSort.elem));
    }
}
